<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<div id="btn">
			<div>
				<span></span>
				<span></span>
				<p></p>
			</div>
			<div></div>
			<div></div>
			<div></div>
		</div>
	</body>
	<script>
		for (var i = 0; i < btn.children.length; i++) {
			btn.children[i].style.width = '200px';
			btn.children[i].style.height = '200px';
			btn.children[i].style.background = 'red';
			btn.children[i].style.margin = '10px';
		}

			btn.children[0].children[1].style.width = '20px';
			btn.children[0].children[1].style.height = '20px';
			btn.children[0].children[1].style.background = 'yellow';
	


		// 封装一个生成颜色的函数
		function getRandomColor() {
			var letters = '0123456789ABCDEF';
			var color = '#';
			for (var i = 0; i < 6; i++) {
				color += letters[Math.floor(Math.random() * 16)];
			}
			return color
		}
	</script>
</html>